#include <Arduino.h>

// put function declarations here:
int led_pin = 9;
int data_pin = A0;
void blink();
int data_val;

void setup()
{
  // put your setup code here, to run once:
  pinMode(led_pin, OUTPUT);
  pinMode(data_pin,INPUT);
}

void loop()
{
  // put your main code here, to run repeatedly:
  int new_val = analogRead(data_pin);
  if (abs(new_val - data_val) > 100){
    blink();
    data_val = new_val;
  }
  else{

  }
}

// put function definitions here:
void blink()
{
  for (int i = 0; i < 2; i++)
  {
    digitalWrite(led_pin, HIGH);
    delay(100);
    digitalWrite(led_pin, LOW);
    delay(100);
  }
}